/**
 * Created by 小虎Oni on 2016/9/30.
 */
var React = require('react');
var ReactDom = require('react-dom');
var AMUIReact  = require('amazeui-react');
var AMUITouch = require('amazeui-touch');
var Container = AMUITouch.Container;
var View = AMUITouch.View;
var OniStore = require('../utils/OniStore');
var jquery = require('jquery');
var Field = AMUITouch.Field;
var Icon = AMUITouch.Icon;
var List = AMUITouch.List;
var Button = AMUITouch.Button;
var NavBar = AMUITouch.NavBar;
var RouteInstance = require('react-router');
var Link = RouteInstance.Link;
//var WebApiUtils = require('../utils/WebApiUtils');
//var TestActionCreators = require('../actions/TestActionCreators')

var Home = React.createClass({
    getInitialState: function () {
        return{
            title:OniStore.getData('FIRST_TEST_ACTION')
        }
    },
    componentDidMount: function () {
        OniStore.addChangeListener('FIRST_TEST_ACTION',this.onTestChange);
    },
    componentWillUnmount: function () {
        OniStore.removeChangeListener('FIRST_TEST_ACTION',this.onTestChange);
    },
    onTestChange: function () {
      this.setState({
          title:OniStore.getData('FIRST_TEST_ACTION')
      });
    },
    render:function(){
        var title = this.state.title;
        return (
            <View id="app-index">
                <Container scrollable>
                    <div className="home-background">
                        <div className="home-bg-content">
                            <h1 className="home-bg-title">我们在找<h1 className="home-bg-title-red">最对的人</h1></h1>
                            <h3 className="home-bg-title">我们打造对好的·IT生态服务圈</h3>
                            <h4 className="home-bg-title">蝙蝠众包</h4>
                        </div>
                    </div>
                    <div className="home-btn">
                        <Link to="/login"><Button amStyle="alert" className="btn-login">注册/登录</Button></Link>
                        <Button amStyle="alert" className="btn-test">先用用看</Button>
                    </div>
                </Container>
            </View>
        );
    }
});
//
module.exports = Home;